"use strict"

/**
 * 西安市政府采购网爬虫
 *  
 */

var Base = require("./base");
var xa_spider = new Base();
xa_spider.name = "西安市政府采购网";

xa_spider.getPageUrl = function (pg) {
    var url = "http://www.xaczj.gov.cn/zfcg.htm";
    if(pg!=1)
    {
        url = "http://www.xaczj.gov.cn/zfcg/95"+pg+".htm";
    } 
    return url;
};

xa_spider.getItems = function ($) {
    var items = [];
    $(".winstyle48653 tr td a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.attr("title");
        item.url = "http://www.xaczj.gov.cn" + e.attr("href");
        item.source = xa_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = xa_spider;